package cn.lizemin.observer.origin;

import cn.lizemin.observer.origin.entity.Buyer;
import cn.lizemin.observer.origin.entity.Shop;

/**
 * @author lzm
 * @version 1.0
 * @description: TODO
 * @date 2022/4/20 11:19
 */
public class Client {
    /**
     * 程序的入口
     */
    public static void main(String[] args) {
        /**
         * 程序的缺陷：三个人因为在商店无货而被阻塞，直到商店进货满足需求后，他们才走，这样不人性化，
         * 效率也低
         */
        Shop shop = new Shop();
        Buyer lzm = new Buyer("lzm", shop);
        Buyer zs = new Buyer("zs", shop);
        Buyer ls = new Buyer("ls", shop);
        lzm.buy();
        zs.buy();
        ls.buy();

        System.out.println("商店开始进货。。。");
        shop.setProduct("MacBook pro");
        lzm.buy();

    }

}
